## Sid Meier's Civilization 4
## Copyright Firaxis Games 2005
##
## sdEventManager by Stone-D (Laga Mahesa)
## Copyright Laga Mahesa 2005
##
## Version CultureConquest 1.30


############## EVENT MANAGER GLOBALS ################
from CvPythonExtensions import *
import CvUtil
import PyHelpers
import Popup as PyPopup
import sys

gc = CyGlobalContext()
PyPlayer = PyHelpers.PyPlayer
PyInfo = PyHelpers.PyInfo

import CvEventManager

import EnhancedCultureConquestUtils

enhancedCultureConquestUtils = EnhancedCultureConquestUtils.EnhancedCultureConquestUtils()


############## EVENTMANAGER SUBCLASS ################
class CvEnhancedCultureConquestEventManager:
	def __init__(self, eventManager):

		eventManager.addEventHandler("cityAcquired", self.onCityAcquired)
		eventManager.addEventHandler("cityBuilt", self.onCityBuilt)
		eventManager.addEventHandler("cityRazed", self.onCityRazed)
		eventManager.addEventHandler("cityLost", self.onCityRazed)
		eventManager.addEventHandler("windowActivation", self.onWindowActivation)

		EnhancedCultureConquestUtils.loadConfigurationData()
					
					
	def onWindowActivation(self, argsList):
		'Called when the game window activates or deactivates'

		EnhancedCultureConquestUtils.loadConfigurationData()


	def onCityAcquired(self, argsList):
		enhancedCultureConquestUtils.handleCityConquered(argsList)


	def onCityBuilt(self, argsList):
		enhancedCultureConquestUtils.handleCityBuilt(argsList[0])


	def onCityRazed(self, argsList):
		enhancedCultureConquestUtils.handleCityRazed(argsList[0])
